<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>Simple Counter</title>
	</head>
	<body>
		<div id="example-2">
			<simple-counter></simple-counter>
			<simple-counter></simple-counter>
			<simple-counter></simple-counter>
		</div>
		<script type="text/javascript" src="js/vue.js" ></script>
		<script type="text/javascript">
			// 注册
			Vue.component('simple-counter', {
				template: '<button v-on:click="counter += 1">{{ counter }}</button>',
				data: function () {
					return {counter: 0};
				}
			});
			
			// 创建根实例
			new Vue({
				el: '#example-2'
			});
		</script>
	</body>
</html>
